{ config, pkgs, ... }:

{  imports =
    [ # Include the results of the hardware scan.
    ./network.nix
    ./characters.nix
    ];


environment = {
    shells = [ pkgs.bashInteractive pkgs.zsh ];
    shellInit = ''
      export GPG_TTY="$(tty)"
    '';
};
programs.zsh.enable = true;
users.defaultUserShell  = pkgs.zsh;

  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  nix.gc = {
    automatic = true;
    dates = "weekly";
    options = "--delete-older-than 1w";
  };

  networking.hostName = "thinkpad"; # Define your hostname.

  services.flatpak.enable = true;


  system.stateVersion = "23.05"; # Did you read the comment?
  # Set your time zone.
  time.timeZone = "Asia/Shanghai";
  # Select internationalisation properties.

  programs.dconf.enable = true;
  nixpkgs.config.allowUnfree = true;
  environment.systemPackages = with pkgs; [
    vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
    wget
    curl
    docker-compose
    git
    sysstat
    lm_sensors  # for `sensors` command
    # minimal screen capture tool, used by i3 blur lock to take a screenshot
    # print screen key is also bound to this tool in i3 config
    scrot
    neofetch
    nnn          # terminal file manager
    bash-completion
    alacritty
    pciutils
    clash
    zsh
    lshw
    oh-my-zsh
  ];

  # Enable sound with pipewire.
  sound.enable = true;
  sound.mediaKeys.enable = true;

  security.rtkit.enable = true;
  hardware.pulseaudio.enable = false;

  hardware.pulseaudio.package = pkgs.pulseaudioFull;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
  };
  environment.etc = {
    "wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''
      bluez_monitor.properties = {
        ["bluez5.enable-sbc-xq"] = true,
        ["bluez5.enable-msbc"] = true,
        ["bluez5.enable-hw-volume"] = true,
        ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
      }
    '';
  };
virtualisation.libvirtd.enable=true;
virtualisation.docker.enable = true;
virtualisation.docker.storageDriver = "btrfs";
virtualisation.docker.extraOptions = "--registry-mirror https://docker.mirrors.ustc.edu.cn";
  services.packagekit.enable = false;
  services.power-profiles-daemon = {
    enable = true;
  };
  services.xserver.enable = true;
  services.xserver.layout = "us";
  services.openssh = {
    enable = true;
    settings.PermitRootLogin = "yes";
  };

    users.users.isidore = {
      isNormalUser = true;
      extraGroups = [ "wheel" "docker" "audio" "sound" "libvirt" "libvirt-qemu" "kvm" "input" "disk"]; # Enable ‘sudo’ for the user.
      password = "123";
    };

}

